﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NoodlesFriedFood
{
    public class PlcModel
    {
        public string jsonrpc { get; set; } = "2.0";
        public string method { get; set; }
        [JsonProperty("params")]
        public PlcList paramss { get; set; }
        public int id { get; set; } = 1;
    }
    public class PlcModelWrite
    {
        public string jsonrpc { get; set; } = "2.0";
        public string method { get; set; }
        [JsonProperty("params")]
        public PlcListWrite paramss { get; set; }
        public int id { get; set; } = 1;
    }
    public class PlcReadModel
    {
        public string jsonrpc { get; set; } = "2.0";
        public string result { get; set; }
        public int id { get; set; } = 1;
    }
    public class PlcList
    {
        public string var { get; set; } = "\"Com_Data\"";


    }
    public class PlcListWrite
    {
        public string var { get; set; } = "\"Com_Data\"";

        public int value { get; set; } = 1;
    }
    public class statelist
    {
        private static statelist instance;
        private statelist() { }

        public static statelist Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new statelist();
                }
                return instance;
            }
        }
        public List<string> state = new List<string>()
        {
        "\"Com_Data\".State.Matter1",
         "\"Com_Data\".State.Matter2",
          "\"Com_Data\".State.Matter3",
           "\"Com_Data\".State.Matter4",
            "\"Com_Data\".State.Matter5",
             "\"Com_Data\".State.Matter6",
              "\"Com_Data\".State.Matter7",
               "\"Com_Data\".State.Matter8",
                "\"Com_Data\".State.Matter9",
                 "\"Com_Data\".State.Matter10",
                  "\"Com_Data\".State.Matter11",
                   "\"Com_Data\".State.Matter12",
                    "\"Com_Data\".State.Matter13",
                     "\"Com_Data\".State.Matter14",
                      "\"Com_Data\".State.Matter15",
                       "\"Com_Data\".State.Jaka1_Error",
                        "\"Com_Data\".State.Jaka2_Error",
                         //"\"Com_Data\".State.Making_m",
                         // "\"Com_Data\".State.Making_z",
                           "\"Com_Data\".State.Making1_1",
             "\"Com_Data\".State.Making1_2",
              "\"Com_Data\".State.Making1_3",
               "\"Com_Data\".State.Making2_1",
                "\"Com_Data\".State.Making2_2"
    };
        public List<string> command = new List<string>()
        {
        "\"Com_Data\".State.Action1",
         "\"Com_Data\".State.Action2",
          "\"Com_Data\".State.Order1",
           "\"Com_Data\".State.Order2",
            "\"Com_Data\".State.Order3"
    };
    }
    public class list
    {
        public List<PlcModel> plcModels { get; set; } = new List<PlcModel>();
    }
    public class PlcRead
    {
        //"jsonrpc":"2.0","id":1,"result":0
        public string jsonrpc { get; set; } = "2.0";
        public int id { get; set; } = 0;
        public int result { get; set; } = 0;
    }
}
